# 字典遍历
dict1 = {'name': 'hello', 'age': 18}

# 字典键key的遍历
for key in dict1:  # TODO 遍历键 keys 或者 默认就是keys
    print(key)

for key in dict1.keys():
    print(key)

print('--' * 20)

# 字典值value的遍历
for value in dict1.values():
    print(value)

print('--' * 20)

# 字典的键值对的遍历
for key, value in dict1.items():
    print(key, value)
